package com.main.common.utils.listener;

import cn.dev33.satoken.annotation.handler.SaAnnotationHandlerInterface;
import cn.dev33.satoken.config.SaTokenConfig;
import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpLogic;
import org.springframework.stereotype.Component;

/**
 * 自定义侦听器的实现
 */
@Component
public class SaTokenListener implements cn.dev33.satoken.listener.SaTokenListener {


    @Override
    public void doLogin(String s, Object o, String s1, SaLoginModel saLoginModel) {
        System.out.println(s);
        System.out.println(o);
        System.out.println(s1);
        System.out.println("doLogin");
    }

    @Override
    public void doLogout(String s, Object o, String s1) {
        System.out.println(s);
        System.out.println(o);
        System.out.println(s1);
        System.out.println("doLogout");
    }

    @Override
    public void doKickout(String s, Object o, String s1) {
        System.out.println("doKickout");
    }

    @Override
    public void doReplaced(String s, Object o, String s1) {
        System.out.println("doReplaced");
    }

    @Override
    public void doDisable(String s, Object o, String s1, int i, long l) {
        System.out.println("doDisable");
    }

    @Override
    public void doUntieDisable(String s, Object o, String s1) {
        System.out.println("doUntieDisable");
    }

    @Override
    public void doOpenSafe(String s, String s1, String s2, long l) {
        System.out.println("doOpenSafe");
    }

    @Override
    public void doCloseSafe(String s, String s1, String s2) {
        System.out.println("doCloseSafe");
    }

    @Override
    public void doCreateSession(String s) {
        System.out.println("doCreateSession");
    }

    @Override
    public void doLogoutSession(String s) {
        System.out.println("doLogoutSession");
    }

    @Override
    public void doRenewTimeout(String s, Object o, long l) {
        System.out.println("doRenewTimeout");
    }

    @Override
    public void doRegisterComponent(String compName, Object compObj) {
        cn.dev33.satoken.listener.SaTokenListener.super.doRegisterComponent(compName, compObj);
        System.out.println("doRegisterComponent");
    }

    @Override
    public void doRegisterAnnotationHandler(SaAnnotationHandlerInterface<?> handler) {
        cn.dev33.satoken.listener.SaTokenListener.super.doRegisterAnnotationHandler(handler);
        System.out.println("doRegisterAnnotationHandler");
    }

    @Override
    public void doSetStpLogic(StpLogic stpLogic) {
        cn.dev33.satoken.listener.SaTokenListener.super.doSetStpLogic(stpLogic);
        System.out.println("doSetStpLogic");
    }

    @Override
    public void doSetConfig(SaTokenConfig config) {
        cn.dev33.satoken.listener.SaTokenListener.super.doSetConfig(config);
        System.out.println("doSetConfig");
    }
}

